package org.dromara.common.idempotent.config;

import org.dromara.common.idempotent.aspectj.RepeatSubmitAspect;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConfiguration;


/**
 * @Author 刘武贵
 * @Date 2024/8/15 22:00
 * @Description 功能描述：幂等功能配置
 */
@AutoConfiguration(after = RedisConfiguration.class)
public class IdempotentConfig {

    /**
     * 配置一个RepeatSubmitAspect切面 bean
     * 该切面用于拦截重复提交的请求，确保业务逻辑的正确性
     *
     * @return RepeatSubmitAspect的实例，用于处理重复提交的请求
     */
    @Bean
    public RepeatSubmitAspect repeatSubmitAspect() {
        return new RepeatSubmitAspect();
    }


}
